package com.sxh.user.Utils;

import org.apache.rocketmq.client.producer.SendCallback;
import org.apache.rocketmq.client.producer.SendResult;
//自定义回调类
public class LogSendCallback implements SendCallback {
    private final String logId;

    public LogSendCallback(String logId) {
        this.logId = logId;
    }

    @Override
    public void onSuccess(SendResult result) {
        System.out.println("日志ID " + logId + " 发送成功，MsgID: " + result.getMsgId());
    }

    @Override
    public void onException(Throwable e) {
        System.err.println("日志ID " + logId + " 发送失败: " + e.getMessage());
    }
}
